<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class MenusSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {

        $insertArr = [
            ['name' => '运营管理', 'alias' => 'operation.manage', 'url' => '/operation', 'parentId' => 0, 'type' => 0, 'status' => 0, 'isDeleted' => 0, 'createdAt' => time(), 'updatedAt' => time()],
            ['name' => '菜品管理', 'alias' => 'operation.product', 'url' => '/operation/product', 'parentId' => 1, 'type' => 0, 'status' => 0, 'isDeleted' => 0, 'createdAt' => time(), 'updatedAt' => time()],
            ['name' => '门店管理', 'alias' => 'operation.shop', 'url' => '/operation/shop', 'parentId' => 1, 'type' => 0, 'status' => 0, 'isDeleted' => 0, 'createdAt' => time(), 'updatedAt' => time()],
            ['name' => '菜品库', 'alias' => 'operation.product.list', 'url' => '/operation/product/list', 'parentId' => 2, 'type' => 0, 'status' => 0, 'isDeleted' => 0, 'createdAt' => time(), 'updatedAt' => time()],
            ['name' => '菜单模板', 'alias' => 'operation.product.template', 'url' => '/operation/product/template', 'parentId' => 2, 'type' => 0, 'status' => 0, 'isDeleted' => 0, 'createdAt' => time(), 'updatedAt' => time()],
            ['name' => '门店菜品管理', 'alias' => 'operation.product.shop', 'url' => '/operation/product/shop', 'parentId' => 2, 'type' => 0, 'status' => 0, 'isDeleted' => 0, 'createdAt' => time(), 'updatedAt' => time()],
            ['name' => '菜品单位', 'alias' => 'operation.product.unit', 'url' => '/operation/product/unit', 'parentId' => 2, 'type' => 0, 'status' => 0, 'isDeleted' => 0, 'createdAt' => time(), 'updatedAt' => time()],
            ['name' => '菜品分类', 'alias' => 'operation.product.category', 'url' => '/operation/product/category', 'parentId' => 2, 'type' => 0, 'status' => 0, 'isDeleted' => 0, 'createdAt' => time(), 'updatedAt' => time()],
        ];

        DB::table('menus')->truncate();
        DB::table('menus')->insert($insertArr);
    }
}
